//
//  XRNetTool.h
//  XRApp
//
//  Created by 刘鑫奇 on 16/7/13.
//  Copyright © 2016年 薪茹高. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^successBlock)(id result);
typedef void(^failureBlock)(NSError *error);

typedef NS_ENUM(NSUInteger, XRResponseStyle) {
    XRJSON,
    XRDATA,
    XRXML,
};

typedef NS_ENUM(NSUInteger, XRRequestStyle) {
    XRBodyString,
    XRBodyJSON,
};

@interface XRNetTool : NSObject

+ (void)GET:(NSString *)url
       body:(id)body
 headerFile:(NSDictionary *)headers
   response:(XRResponseStyle)responseStyle
    success:(successBlock)success
    failure:(failureBlock)failure;


+ (void)POST:(NSString *)url
        body:(id)body
   bodyStyle:(XRRequestStyle)bodyStyle
  headerFile:(NSDictionary *)headers
    response:(XRResponseStyle)responseStyle
     success:(successBlock)success
     failure:(failureBlock)failure;


@end
